package com.server.impl;

import com.dao.shopping.ShoppingMapper;
import com.entry.Product;
import com.entry.Shopping;
import com.server.ShoppingService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ShoppingServiceImpl implements ShoppingService {

    @Resource
    ShoppingMapper shoppingMapper;

    @Override
    public List<Shopping> getShoppingListPay(int member_id) {
        return shoppingMapper.getShoppingListPay(member_id);
    }

    @Override
    public List<Shopping> getShoppingListPayList(int member_id, int product_id) {
        return shoppingMapper.getShoppingListPayList(member_id, product_id);
    }

    @Override
    public int updateCartChecked(int product_id, int member_id,int shopping_checked) {
        return shoppingMapper.updateCartChecked(product_id, member_id,shopping_checked);
    }

    @Override
    public int getCount(int member_id) {
        return shoppingMapper.getCount(member_id);
    }

    @Override
    public List<Shopping> getShoppingList(int member_id) {
        return shoppingMapper.getShoppingList(member_id);
    }

    @Override
    public int addCart(int member_id,int product_id,int shopping_product_amount) {
        return shoppingMapper.addCart(member_id, product_id, shopping_product_amount);
    }

    @Override
    public int addCartChecked(int member_id, int product_id, int shopping_product_amount,int shopping_checked) {
        return shoppingMapper.addCartChecked(member_id, product_id, shopping_product_amount,shopping_checked);
    }

    @Override
    public int updateCartCount(int member_id, int product_id, int shopping_product_amount) {
        return shoppingMapper.updateCartCount(member_id, product_id, shopping_product_amount);
    }

    @Override
    public Shopping getCountById(int member_id, int product_id) {
        return shoppingMapper.getCountById(member_id, product_id);
    }

    @Override
    public int delCartProduct(int member_id, int product_id) {
        return shoppingMapper.delCartProduct(member_id, product_id);
    }

    @Override
    public int delCartProducts(int member_id) {
        return shoppingMapper.delCartProducts(member_id);
    }

    @Override
    public int delCartProductByChecked(int member_id, int product_id) {
        return shoppingMapper.delCartProductByChecked(member_id, product_id);
    }

    @Override
    public int delCartProductByCheckeds(int member_id, int shopping_checked) {
        return shoppingMapper.delCartProductByCheckeds(member_id, shopping_checked);
    }

    @Override
    public int delCartProductById(int member_id) {
        return shoppingMapper.delCartProductById(member_id);
    }

}
